<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Drag Zoom with Visual Control</title>
       <script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAjU0EJWnWPMv7oQ-jjS7dYxQGj0PqsCtxKvarsoS-iqLdqZSKfxRdmoPmGl7Y9335WLC36wIGYa6o5Q" type="text/javascript">
        </script>
        <script type="text/javascript">
         document.write('<script type="text/javascript" src="../src/keydragzoom'+(document.location.search.indexOf('packed')>-1?'_packed':'')+'.js"><'+'/script>');
        </script>
        <script type="text/javascript">
        var map;
        function init() {
          map = new GMap2(document.getElementById("map"));
          map.setCenter(new GLatLng(49.2903, -123.1294), 13);
          map.addControl(new GMapTypeControl());
          map.addControl(new GLargeMapControl());
          map.addControl(new GScaleControl());

          map.enableKeyDragZoom({
            visualEnabled: true,
            visualPosition: new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(27, 285)),
            visualSprite: "http://maps.gstatic.com/mapfiles/ftr/controls/dragzoom_btn.png",
            visualSize: new google.maps.Size(20, 20),
            visualTips: {
              off: "Turn on",
              on: "Turn off"
            }
          });
        }
        </script>

<style>
#map {
width: 700px;
height: 400px;
}
</style>

    </head>
    <body onload="init()">
       <a href='?packed'>Packed</a> | <a href='?'>Unpacked</a> Version of the script.

       <br />
       Hold down the <span style="color: red; font-weight: bold;" >Shift</span> key while dragging a box or use the visual control below the zoom control to turn drag zoom on and off.

       <div id="map" style="border: 2px solid black;"></div>

    </body>
</html>